package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Param;
import org.csu.mypetstore.domain.Cart;
import org.csu.mypetstore.domain.Item;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface ItemMapper {
    List<Item> getItemListByProduct(String productId);
    int getInventoryQuantity(String itemId);
    Item getItem(String itemId);
    void updateInventoryQuantity(Map<String, Object> param);
    int isOnsale(String itemId);
    void updateItemQuantity(String itemId);
    void insertItem(@Param("itemId")String itemId,@Param("username")String username);
    void removeItemQuantity(@Param("itemId")String itemId, @Param("username")String username);
    void remove(@Param("itemId")String itemId, @Param("username")String username);
    void clear(String username);
}
